package www.qiyue.bj;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * 合同导入批量处理
 */
@RestController
public class Bj_contract_con {
    @Autowired
    private JdbcTemplate jdbcTemplate;


    public String test(){
        String conSql="SELECT * from ais_contract";
        String rentid="UPDATE ais_contract a inner join ais_rent_unit b on a.rent_unit_code = b.rent_unit_code set a.rent_unit_id = b.id";
        String cusid="UPDATE ais_contract a inner join ais_customer b on a.customer_name = b.customer_name set a.customer_id = b.id";
        String netid="UPDATE ais_contract a inner join ais_network b on a.network_admin = b.network_name set a.network_admin = b.id";
        String syscode="UPDATE ais_contract a inner join t_s_depart b on CONVERT( a.sys_org_code USING gbk ) = CONVERT( b.departname USING gbk ) set a.sys_org_code = CONVERT( b.org_code USING gbk )";
        String comid= "UPDATE ais_contract a inner join ais_company b on a.company_id = b.company_name set a.company_id=b.id";
        String propSql="UPDATE ais_contract a SET a.property_type=(CASE WHEN a.property_type='甲方' THEN '10' ELSE '20' END)";
        String regDate="UPDATE ais_contract a SET a.register_date=NOW()";
        String sta="UPDATE ais_contract a SET a.status_id='01'";
        String app="UPDATE ais_contract a  SET a.approved_type='10'";
        String appSql="UPDATE ais_contract a  SET a.approval_steps='1'";


        List<Map<String, Object>> conList = jdbcTemplate.queryForList(conSql);
        for (Map<String, Object> con : conList) {

        }
        return null;
    }
}
